* Change to right directory *

use "gk_biofuels_CCES.dta", clear


* Create Support for Tax Credit DV *

gen biofuelstaxcredit = BOS401
recode biofuelstaxcredit (8=.) (1=4) (2=3) (3=2) (4=1)
gen biofuelstaxcreditbin = biofuelstaxcredit
recode biofuelstaxcreditbin  (4=1) (3=1) (2=0) (1=0)

* Create Experimental Condition Dummies *

gen biocontrol = BOS401_treat
recode biocontrol (2=0) (3=0)
label var biocontrol "Control treatment"

gen biosupport = BOS401_treat
recode biosupport (1=0) (2=1) (3=0)
label var biosupport "Support treatment"

gen biooppose = BOS401_treat
recode biooppose (3=1) (1=0) (2=0)
label var biooppose "Opposition treatment"

* Create demographics *
gen dem3 = 0
replace dem3 = 1 if pid7 == 1
replace dem3 = 1 if pid7 == 2
gen dem5 = dem3
replace dem5 = 1 if pid7 == 3
gen gop3 = 0
replace gop3 = 1 if pid7 == 6
replace gop3 = 1 if pid7 == 7
gen gop5 = gop3
replace gop5 = 1 if pid7 == 5
gen ind3 = 0
replace ind3 = 1 if pid7 == 3
replace ind3 = 1 if pid7 == 4
replace ind3 = 1 if pid7 == 5
gen ind5 = 0
replace ind5 = 1 if pid7 == 4
gen party = pid7
recode party (8=.) (9=.) (99=.)
label var party "Party (1= strong Dem; 7 = strong GOP)"
label var dem3 "Democrat"
label var gop3 "Republican"
label var dem5 "Democrat (including leaners)"
label var gop5 "Republican (including leaners)"
gen education = educ
label var education "Education"
gen age = 2014-birthyr
label var age "Age"
gen white = 0
replace white = 1 if race == 1
label var white "White"
gen male = gender
recode male (2=0)
label var male "Male"

* Note: gas prices data provided by Hakan Yilmazkuday and merged into CCES data *
* Citation: D. Yilmazkuday, H. Yilmazkuday, Redistributive Effects of Gasoline Prices, Networks Spat. Econ. 19 (2019) 109–124. https://doi.org/10.1007/s11067-018-9435-9 *

* Table 1 *
label var biosupport "Decrease costs treatment"
label var biooppose "Increase costs treatment"
label var gas_price "Local gasoline price"
gen biosupportxdem5 = biosupport*dem5
label var biosupportxdem5 "Decrease costs x Democrat"
gen biosupportxgop5 = biosupport*gop5
label var biosupportxgop5 "Decrease costs x Republican"
gen bioopposexdem5 = biooppose*dem5
label var bioopposexdem5 "Increase costs x Democrat"
gen bioopposexgop5 = biooppose*gop5
label var bioopposexgop5 "Increase costs x Republican"
gen biosupportxgas = biosupport*gas_price
label var biosupportxgas "Decrease costs x Local gas price"
gen bioopposexgas = biooppose*gas_price
label var bioopposexgas "Increase costs x Local gas price"
label var dem5 "Democrat"
label var gop5 "Republican"
gen gas_pricexdem5 = gas_price*dem5 
label var gas_pricexdem5 "Local gas price x Democrat"
gen gas_pricexgop5 = gas_price*gop5
label var gas_pricexgop5 "Local gas price x Republican"

logit biofuelstaxcreditbin biosupport biooppose dem5 gop5 male education age white gas_price
outreg2 using table1, word  label dec(3) replace
logit biofuelstaxcreditbin biosupport biosupportxgas biooppose bioopposexgas dem5 gop5 male education age white gas_price
outreg2 using table1, word  label dec(3) append
logit biofuelstaxcreditbin biosupport biosupportxdem5 biosupportxgop5 biooppose bioopposexdem5 bioopposexgop5 dem5 gop5 male education age white gas_price
outreg2 using table1, word  label dec(3) append
logit biofuelstaxcreditbin biosupport  biooppose  dem5 gop5 male education age white gas_price gas_pricexdem5 gas_pricexgop5
outreg2 using table1, word  label dec(3) append sortvar(biosupport biooppose biosupportxgas bioopposexgas  biosupportxdem5 biosupportxgop5   bioopposexdem5 bioopposexgop5 gas_pricexdem5 gas_pricexgop5 dem5 gop5 male education age white gas_price)

* Diagnostics on base model *
logit biofuelstaxcreditbin biosupport biooppose dem5 gop5 male education age white gas_price
estat gof, group(10)
linktest
collin biosupport biooppose dem5 gop5 male education age white gas_price
predict p
predict stdres, rstand
sum stdres, detail

* Omitting the 7 observations for which standardized residual is > |3| yields an insignificant linktest suggesting no specification error *
gen outlier = 0
replace outlier =1  if stdres <=-3
logit biofuelstaxcreditbin biosupport biooppose dem5 gop5 male education age white gas_price if outlier !=1
linktest

* SI Table 1: Re-estimate Excluding Outliers *
logit biofuelstaxcreditbin biosupport biooppose dem5 gop5 male education age white gas_price if outlier !=1
outreg2 using sitable1, word  label dec(3) replace
logit biofuelstaxcreditbin biosupport biosupportxgas biooppose bioopposexgas dem5 gop5 male education age white gas_price if outlier !=1
outreg2 using sitable1, word  label dec(3) append
logit biofuelstaxcreditbin biosupport biosupportxdem5 biosupportxgop5 biooppose bioopposexdem5 bioopposexgop5 dem5 gop5 male education age white gas_price if outlier !=1
outreg2 using sitable1, word  label dec(3) append
logit biofuelstaxcreditbin biosupport  biooppose  dem5 gop5 male education age white gas_price gas_pricexdem5 gas_pricexgop5 if outlier !=1
outreg2 using sitable1, word  label dec(3) append sortvar(biosupport biooppose biosupportxgas bioopposexgas  biosupportxdem5 biosupportxgop5   bioopposexdem5 bioopposexgop5 gas_pricexdem5 gas_pricexgop5 dem5 gop5 male education age white gas_price)

* SI Table 2: Ordered logit with 4-point scale DV *
ologit biofuelstaxcredit biosupport biooppose dem5 gop5 male education age white gas_price
outreg2 using sitable3, word  label dec(3) replace
ologit biofuelstaxcredit biosupport biosupportxgas biooppose bioopposexgas dem5 gop5 male education age white gas_price
outreg2 using sitable3, word  label dec(3) append
ologit biofuelstaxcredit biosupport biosupportxdem5 biosupportxgop5 biooppose bioopposexdem5 bioopposexgop5 dem5 gop5 male education age white gas_price
outreg2 using sitable3, word  label dec(3) append
ologit biofuelstaxcredit biosupport  biooppose  dem5 gop5 male education age white gas_price gas_pricexdem5 gas_pricexgop5
outreg2 using sitable3, word  label dec(3) append sortvar(biosupport biooppose biosupportxgas bioopposexgas  biosupportxdem5 biosupportxgop5   bioopposexdem5 bioopposexgop5 gas_pricexdem5 gas_pricexgop5 dem5 gop5 male education age white gas_price)

* SI Table 3: OLS with 4-point scale DV *
reg biofuelstaxcredit biosupport biooppose dem5 gop5 male education age white gas_price
outreg2 using sitable4, word  label dec(3) replace
reg biofuelstaxcredit biosupport biosupportxgas biooppose bioopposexgas dem5 gop5 male education age white gas_price
outreg2 using sitable4, word  label dec(3) append
reg biofuelstaxcredit biosupport biosupportxdem5 biosupportxgop5 biooppose bioopposexdem5 bioopposexgop5 dem5 gop5 male education age white gas_price
outreg2 using sitable4, word  label dec(3) append
reg biofuelstaxcredit biosupport  biooppose  dem5 gop5 male education age white gas_price gas_pricexdem5 gas_pricexgop5
outreg2 using sitable4, word  label dec(3) append sortvar(biosupport biooppose biosupportxgas bioopposexgas  biosupportxdem5 biosupportxgop5   bioopposexdem5 bioopposexgop5 gas_pricexdem5 gas_pricexgop5 dem5 gop5 male education age white gas_price)

* Figure 1 *
hist gas_price, xlabel(3 3.25 3.50 3.75 4.00 4.25) percent graphregion(fcolor(white)) yti("Percent of sample" " ") xti(" " "Local gas price ($ per gallon)")
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color(gs5))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color(black))) editcopy

* Figure 2 *
logit biofuelstaxcreditbin i.BOS401_treat dem5 gop5 male education age white gas_price
margins, at(BOS401_treat=(1(1)3) gop5=(0) dem5=(0)  white=(1) male=(0)  education=(3) age=(52)) vsquish atmeans  post
marginsplot, x(BOS401_treat) ytitle("Support for tax credit" "   ") graphregion(fcolor(white)) xlabel(1 "Control" 2 "Decrease costs" 3 "Increase costs") xscale(range(.75,3.25)) xti("") ti("") ylabel(.4 .5 .6 .7 .8 .9) recast(scatter)

* Figure 3*
logit biofuelstaxcreditbin i.BOS401_treat##c.gas_price gop5 dem5 male education age white 
margins, at(BOS401_treat=(1(1)3) gas_price=(3(.1)4.2)   white=(1) male=(0)  education=(3) age=(52)) vsquish atmeans
marginsplot, x(gas_price)  recast(line) recastci(rarea)    ytitle("Support for tax credit" "   ") graphregion(fcolor(white)) xti(" " "Local gas price ($ per gallon)") ti("") legend(order(2 "Decrease costs treatment" 3 "Increase costs treatment"))
gr_edit .plotregion1.plot1.draw_view.setstyle, style(no)
gr_edit plotregion1.plot4.draw_view.setstyle, style(no)
gr_edit plotregion1.plot5.style.editstyle line(color(black)) editcopy
gr_edit plotregion1.plot2.style.editstyle area(shadestyle(color(gs12))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color(gs12))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(shadestyle(color(gs5))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color(gs5))) editcopy
gr_edit plotregion1.plot6.style.editstyle line(pattern(dash)) editcopy
gr_edit plotregion1.plot6.style.editstyle line(color(black)) editcopy
gr_edit plotregion1.plot3.style.editstyle area(shadestyle(color(gs10))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color(gs10))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color("%75"))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(shadestyle(color("%75"))) editcopy

* Figure 4 *
gen party5 = .
replace party5 = 1 if dem5==0 & gop5 == 0
replace party5 = 2 if dem5 == 1
replace party5 = 3 if gop5 == 1
* Left panel *
logit biofuelstaxcreditbin i.biosupport##i.party5  i.biooppose##i.party5 male education age white gas_price
margins, at(biosupport=(0(1)1) party5=(1(1)3) biooppose=(0)  white=(1) male=(0) education=(3) age=(52)) vsquish atmeans
marginsplot, x(biosupport)  recast(line) xscale(range(-.1 1.1)) yscale(range(.45 .95))  ylabel(.5 .6 .7 .8 .9)   ytitle("Support for tax credit" "   ") graphregion(fcolor(white)) legend(order(4 "Independents" 5 "Democrats" 6 "Republicans") rows(1)) ti("") 
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color(blue))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color(black))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color(red))) editcopy
gr_edit plotregion1.plot4.style.editstyle line(pattern(dash) color(black)) editcopy
gr_edit plotregion1.plot5.style.editstyle line(color(blue)) editcopy
gr_edit plotregion1.plot6.style.editstyle line(pattern(shortdash) color(red)) editcopy

* Right panel *
logit biofuelstaxcreditbin i.biosupport##i.party5  i.biooppose##i.party5 male education age white gas_price
margins, at(biooppose=(0(1)1) party5=(1(1)3) biosupport=(0)  white=(1) male=(0)  education=(3) age=(52)) vsquish atmeans
marginsplot, x(biooppose)  recast(line) xscale(range(-.1 1.1)) yscale(range(.45 .95))   ylabel(.5 .6 .7 .8 .9)  ytitle("Support for tax credit" "   ") graphregion(fcolor(white)) legend(order(4 "Independents" 5 "Democrats" 6 "Republicans") rows(1)) ti("")
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color(blue))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color(black))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color(red))) editcopy
gr_edit plotregion1.plot4.style.editstyle line(pattern(dash) color(black)) editcopy
gr_edit plotregion1.plot5.style.editstyle line(color(blue)) editcopy
gr_edit plotregion1.plot6.style.editstyle line(pattern(shortdash) color(red)) editcopy

* Combine using grc1leg2 *

* Figure 5 *
logit biofuelstaxcreditbin biosupport biooppose c.gas_price##i.party5  male education age white 
margins, at(gas_price=(3(.1)4.2) party5=(1(1)3)  white=(1) male=(0)  education=(3) age=(52)) vsquish atmeans
marginsplot, x(gas_price)  recast(line) recastci(rarea)    ytitle("Support for tax credit" "   ") graphregion(fcolor(white)) legend(order(4 "Independents" 5 "Democrats" 6 "Republicans") rows(1)) xti(" " "Local gas price ($ per gallon)") ti("")
gr_edit plotregion1.plot4.style.editstyle line(pattern(dash) color(black)) editcopy
gr_edit plotregion1.plot5.style.editstyle line(color(blue)) editcopy
gr_edit plotregion1.plot6.style.editstyle line(pattern(shortdash) color(red)) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color(gs10)) linestyle(color(gs10))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(shadestyle(color(ltblue)) linestyle(color(ltblue))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(shadestyle(color(maroon)) linestyle(color(maroon))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color("%75"))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(shadestyle(color("%75"))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color("%75"))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(shadestyle(color("%75"))) editcopy

* SI Figure 1: Made with data from Yilmazkuday and Yilmazkuday (2019) *

* SI Figure 2: Replicating Figure 3 with Ordered Logit models (for strongly support response option) and OLS using 4-point ordinal scale DV *

ologit biofuelstaxcredit i.BOS401_treat##c.gas_price gop5 dem5 male education age white 
margins, at(BOS401_treat=(1(1)3) gas_price=(3(.1)4.2)   white=(1) male=(0)  education=(3) age=(52)) vsquish atmeans predict(outcome(4))
marginsplot, x(gas_price)  recast(line) recastci(rarea)    ytitle("Strongly support tax credit" "   ") ti("Ordered Logit") graphregion(fcolor(white)) xti(" " "Local gas price ($ per gallon)") legend(order(2 "Decrease costs treatment" 3 "Increase costs treatment"))
gr_edit .plotregion1.plot1.draw_view.setstyle, style(no)
gr_edit plotregion1.plot4.draw_view.setstyle, style(no)
gr_edit plotregion1.plot5.style.editstyle line(color(black)) editcopy
gr_edit plotregion1.plot2.style.editstyle area(shadestyle(color(gs12))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color(gs12))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(shadestyle(color(gs5))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color(gs5))) editcopy
gr_edit plotregion1.plot6.style.editstyle line(pattern(dash)) editcopy
gr_edit plotregion1.plot6.style.editstyle line(color(black)) editcopy
gr_edit plotregion1.plot3.style.editstyle area(shadestyle(color(gs10))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color(gs10))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color("%75"))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(shadestyle(color("%75"))) editcopy
* save ologitgas.gph, replace

reg biofuelstaxcredit i.BOS401_treat##c.gas_price gop5 dem5 male education age white 
margins, at(BOS401_treat=(1(1)3) gas_price=(3(.1)4.2)   white=(1) male=(0)  education=(3) age=(52)) vsquish atmeans 
marginsplot, x(gas_price)  recast(line) recastci(rarea)    ytitle("Strongly support tax credit" "   ") ti("OLS") graphregion(fcolor(white)) xti(" " "Local gas price ($ per gallon)") legend(order(2 "Decrease costs treatment" 3 "Increase costs treatment"))
gr_edit .plotregion1.plot1.draw_view.setstyle, style(no)
gr_edit plotregion1.plot4.draw_view.setstyle, style(no)
gr_edit plotregion1.plot5.style.editstyle line(color(black)) editcopy
gr_edit plotregion1.plot2.style.editstyle area(shadestyle(color(gs12))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color(gs12))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(shadestyle(color(gs5))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color(gs5))) editcopy
gr_edit plotregion1.plot6.style.editstyle line(pattern(dash)) editcopy
gr_edit plotregion1.plot6.style.editstyle line(color(black)) editcopy
gr_edit plotregion1.plot3.style.editstyle area(shadestyle(color(gs10))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color(gs10))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color("%75"))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(shadestyle(color("%75"))) editcopy
* save olsgas.gph, replace

* combine with grc1leg2 *
grc1leg2  ologitgas.gph olsgas.gph, graphregion(color(white)) saving(SI_Figure2.gph, replace) 

* SI Figure 3: Replicating Figure 4 with Ordered Logit models (for strongly support response option) and OLS using 4-point ordinal scale DV  *

* Ologit with ordinal DV *
* Left panel *
ologit biofuelstaxcredit i.biosupport##i.party5  i.biooppose##i.party5 male education age white gas_price
margins, at(biosupport=(0(1)1) party5=(1(1)3) biooppose=(0)  white=(1) male=(0) education=(3) age=(52)) vsquish atmeans predict(outcome(4))
marginsplot, x(biosupport)  recast(line) xscale(range(-.1 1.1))   ylabel(.1 .2 .3 .4)   ytitle("Strong support for tax credit" "   ") graphregion(fcolor(white)) legend(order(4 "Independents" 5 "Democrats" 6 "Republicans") rows(1)) ti("") 
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color(blue))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color(black))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color(red))) editcopy
gr_edit plotregion1.plot4.style.editstyle line(pattern(dash) color(black)) editcopy
gr_edit plotregion1.plot5.style.editstyle line(color(blue)) editcopy
gr_edit plotregion1.plot6.style.editstyle line(pattern(shortdash) color(red)) editcopy
* save ologitleft.gph, replace

* Right panel *
ologit biofuelstaxcredit i.biosupport##i.party5  i.biooppose##i.party5 male education age white gas_price
margins, at(biooppose=(0(1)1) party5=(1(1)3) biosupport=(0)  white=(1) male=(0)  education=(3) age=(52)) vsquish atmeans predict(outcome(4))
marginsplot, x(biooppose)  recast(line) xscale(range(-.1 1.1))  ylabel(.1 .2 .3 .4)  ytitle("Strong support for tax credit" "   ") graphregion(fcolor(white)) legend(order(4 "Independents" 5 "Democrats" 6 "Republicans") rows(1)) ti("")
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color(blue))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color(black))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color(red))) editcopy
gr_edit plotregion1.plot4.style.editstyle line(pattern(dash) color(black)) editcopy
gr_edit plotregion1.plot5.style.editstyle line(color(blue)) editcopy
gr_edit plotregion1.plot6.style.editstyle line(pattern(shortdash) color(red)) editcopy
* save ologitright.gph, replace

* combine with grc1leg2 *
grc1leg2  ologitleft.gph ologitright.gph, graphregion(color(white)) saving(ologitparty.gph, replace) ti("Ordered Logit")

* OLS with ordinal DV *
* Left panel *
reg biofuelstaxcredit i.biosupport##i.party5  i.biooppose##i.party5 male education age white gas_price
margins, at(biosupport=(0(1)1) party5=(1(1)3) biooppose=(0)  white=(1) male=(0) education=(3) age=(52)) vsquish atmeans
marginsplot, x(biosupport)  recast(line) xscale(range(-.1 1.1))   ylabel(2 2.5 3 3.5)   ytitle("Support for tax credit" "   ") graphregion(fcolor(white)) legend(order(4 "Independents" 5 "Democrats" 6 "Republicans") rows(1)) ti("") 
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color(blue))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color(black))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color(red))) editcopy
gr_edit plotregion1.plot4.style.editstyle line(pattern(dash) color(black)) editcopy
gr_edit plotregion1.plot5.style.editstyle line(color(blue)) editcopy
gr_edit plotregion1.plot6.style.editstyle line(pattern(shortdash) color(red)) editcopy
* save olsordleft.gph, replace

* Right panel *
reg biofuelstaxcredit i.biosupport##i.party5  i.biooppose##i.party5 male education age white gas_price
margins, at(biooppose=(0(1)1) party5=(1(1)3) biosupport=(0)  white=(1) male=(0)  education=(3) age=(52)) vsquish atmeans 
marginsplot, x(biooppose)  recast(line) xscale(range(-.1 1.1))  ylabel(2 2.5 3 3.5)  ytitle("Support for tax credit" "   ") graphregion(fcolor(white)) legend(order(4 "Independents" 5 "Democrats" 6 "Republicans") rows(1)) ti("")
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color(blue))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color(black))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color(red))) editcopy
gr_edit plotregion1.plot4.style.editstyle line(pattern(dash) color(black)) editcopy
gr_edit plotregion1.plot5.style.editstyle line(color(blue)) editcopy
gr_edit plotregion1.plot6.style.editstyle line(pattern(shortdash) color(red)) editcopy
* save olsordright.gph, replace

* combine with grc1leg2 *
grc1leg2  olsordleft.gph olsordright.gph, graphregion(color(white)) saving(olsordparty.gph, replace) ti("OLS")

grc1leg2 ologitparty.gph olsordparty.gph, graphregion(color(white)) saving(SI_Figure3.gph, replace)



* SI Figure 4: Replicating Figure 3 with Ordered Logit models (for strongly support response option) and OLS using 4-point ordinal scale DV  *
* Ordered Logit with ordinal DV *
ologit biofuelstaxcredit biosupport biooppose c.gas_price##i.party5  male education age white 
margins, at(gas_price=(3(.1)4.2) party5=(1(1)3)  white=(1) male=(0)  education=(3) age=(52)) vsquish atmeans predict(outcome(4))
marginsplot, x(gas_price)  recast(line) recastci(rarea)    ytitle("Strongly support tax credit" "   ") graphregion(fcolor(white)) legend(order(4 "Independents" 5 "Democrats" 6 "Republicans") rows(1)) xti(" " "Local gas price ($ per gallon)") ti("Ordered Logit")
gr_edit plotregion1.plot4.style.editstyle line(pattern(dash) color(black)) editcopy
gr_edit plotregion1.plot5.style.editstyle line(color(blue)) editcopy
gr_edit plotregion1.plot6.style.editstyle line(pattern(shortdash) color(red)) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color(gs10)) linestyle(color(gs10))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(shadestyle(color(ltblue)) linestyle(color(ltblue))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(shadestyle(color(maroon)) linestyle(color(maroon))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color("%75"))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(shadestyle(color("%75"))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color("%75"))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(shadestyle(color("%75"))) editcopy
* save ologitgasparty.gph, replace

* OLS *
reg biofuelstaxcredit biosupport biooppose c.gas_price##i.party5  male education age white 
margins, at(gas_price=(3(.1)4.2) party5=(1(1)3)  white=(1) male=(0)  education=(3) age=(52)) vsquish atmeans
marginsplot, x(gas_price)  recast(line) recastci(rarea)    ytitle("Support tax credit" "   ") graphregion(fcolor(white)) legend(order(4 "Independents" 5 "Democrats" 6 "Republicans") rows(1)) xti(" " "Local gas price ($ per gallon)") ti("OLS")
gr_edit plotregion1.plot4.style.editstyle line(pattern(dash) color(black)) editcopy
gr_edit plotregion1.plot5.style.editstyle line(color(blue)) editcopy
gr_edit plotregion1.plot6.style.editstyle line(pattern(shortdash) color(red)) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color(gs10)) linestyle(color(gs10))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(shadestyle(color(ltblue)) linestyle(color(ltblue))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(shadestyle(color(maroon)) linestyle(color(maroon))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(linestyle(color("%75"))) editcopy
gr_edit plotregion1.plot3.style.editstyle area(shadestyle(color("%75"))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(linestyle(color("%75"))) editcopy
gr_edit plotregion1.plot2.style.editstyle area(shadestyle(color("%75"))) editcopy
* save olsgasparty.gph, replace

grc1leg2 ologitgasparty.gph olsgasparty.gph, graphregion(color(white)) saving(SI_Figure3.gph, replace)

